#ifndef SETTINGWINDOW_H
#define SETTINGWINDOW_H

#include <QDialog>
#include <QSettings>
#include <QListWidgetItem>
#include <QDebug>
#include <QCompleter>
#include <QTextCodec>
#include <QDirModel>

namespace Ui {
class settingWindow;
}

class settingWindow : public QDialog
{
    Q_OBJECT
    
public:
    explicit settingWindow(QWidget *parent = 0);
    ~settingWindow();

    struct WebItem {
        QString name;
        QString url;
        QString files;
    };

    struct ParamManag{
        QString name;
        QString value;
    };

    QList<WebItem> webitems;//все айтемы веб
    QList<ParamManag> latparam;//широты регионов

    QSettings *settings;
    
    void init();
    void saveAndSync();
    void loadSettings();


signals:
    void reloadSettings();

private slots:
    void on_closeButton_clicked();
    void on_maskWidget_itemClicked(QListWidgetItem *item);

    void on_removeMaskButton_clicked();

    void on_clearButton_clicked();

    void on_addMaskButton_clicked();

    void on_maskEdit_returnPressed();

    void on_delButton_clicked();

    void on_addButton_clicked();

    void on_savedList_itemClicked(QListWidgetItem *item);

    void on_httpEdit_returnPressed();

    void on_nameEdit_returnPressed();

    void on_filesEdit_returnPressed();

    void on_pushButton_clicked();

    void on_movedownButton_clicked();

    void on_moveupButton_clicked();

    void on_addLatButton_clicked();

    void on_removeLatButton_clicked();

    void on_latWidget_itemClicked(QListWidgetItem *item);

private:
    Ui::settingWindow *ui;
};

#endif // SETTINGWINDOW_H
